package com.pos43.business.dao.impl;

import java.util.List;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import com.pos43.business.dao.IProductTypeDao;
import com.pos43.domain.ProductType;

public class ProductTypeDao extends HibernateDaoSupport implements IProductTypeDao{

	public ProductType get(Integer id){
		return getHibernateTemplate().get(ProductType.class, id);
	}

	public Integer save(ProductType productType){
		return (Integer)getHibernateTemplate()
			.save(productType);
	}
	
	public void update(ProductType productType){
		getHibernateTemplate().update(productType);
	}
	
	public void delete(ProductType productType){
		getHibernateTemplate().delete(productType);
	}
	
	public void delete(Integer id){
		getHibernateTemplate().delete(get(id));
	}
	
	public List<ProductType> findAll(){
		return (List<ProductType>)getHibernateTemplate()
				.find("from ProductType");
	}

}
